import React, {memo, useEffect, useState} from "react";

import ContentItem from "./content-item/content-item";
import {apiGetFollowList} from "@/api/major";
import styles from './index.module.scss'

const Follow = () => {

  const [follow, setFollow] = useState([])

  useEffect(() => {
    apiGetFollowList({}, true).then(res => {
      setFollow(res.data)
    })
  }, []);

  return (
    <div className={styles.followContainer}>
      {follow.map((item: any) => (
        <ContentItem key={item.id} {...item} />
      ))}
    </div>
  );
}

export default memo(Follow)
